#!/usr/bin/env python
#  -*- coding: utf-8 -*-
__author__ = 'yinq'

name = "my \tname is {name} and i am {year} old"

print(name.capitalize())
print(name.count("e"))
print(name.center(50, "-"))
print(name.endswith("ck"))
print(name.expandtabs(tabsize=30))
print(name.find("is"))  # (name[name.find("dereck"):])
print(name.format(name='dereck', year=30))
print('ab23'.isalnum())
print('abA'.isalpha())
print('1A'.isdecimal())
print('1A'.isdigit())
print('A1'.isidentifier())  # 判断是不是一个合法的标识符
print('33'.isnumeric())
print('My Name'.isupper())
print('+'.join(['1', '2', '3', '4']))
print(name.ljust(50, '*'))
print(name.rjust(50, '-'))
print('Dereck'.lower())
print('dereck'.upper())
print('\ndereck'.lstrip())
print('    dereck\n'.strip())
print('----')
p = str.maketrans("abcdef", '123456')
print("dereck".translate(p))
print('Dereck'.replace('e', 'E'))
print('Dereck yin'.split())
print('Dereck yin'.split('e'))
print('1+2+3+4'.split('+'))
print('Dereck Yin'.swapcase())
print('dereck yin'.title())
print('dereck yin'.zfill(30))

print('mac pro      12000'.strip().split('    '))
